/*
	1,采用一种比较原始的方法引入其他js库,方法名字是:link
	2,采用函数式编程:promise回调 generator[控制全局]  try catch试调  
	3,说明:线下浏览器允许之间Member试调,线上需要转化成es5 Member.build.js
*/
class Business{
	constructor(){
		console.log('welcome into app of Business ................')
		this.link().then(()=>{
			let q = new Public()
		})
	}


	/*path 是要导入的script的路径,这是异步的,引用里面的方法,要注意顺序.先创造script标签,然后加载进去*/
	/*引入的文件也要是换成es5形势才可以*/
	link(path='../Public.build.js'){
		let promise = new Promise((resolve,reject)=>{
			let script = document.createElement('script')
			script.setAttribute('src',path)
			document.body.appendChild(script)
			//创建了标签,资源还没有加载完
			script.onload = ()=>{
				resolve(true)
			}
		})
		return promise
	}
}
var a = new Business()